]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
search: Make overview application search results grid RTL aware
authorKhalid Abu Shawarib <kas@gnome.org>
Mon, 25 Aug 2025 18:08:54 +0000 (21:08 +0300)
committerFlorian Müllner <fmuellner@gnome.org>
Sat, 13 Sep 2025 17:03:45 +0000 (19:03 +0200)
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3851>
(cherry picked from commit 92dc36e7fe14c0e8fba8b297d6a9674f16a7d6be)

js/ui/search.js

index 620ad3ddb95a0422d8ddf045f4f194865ea510b9..3d13dc9daab5c423afa3469db779b1f645231cf5 100644 (file)
@@ -397,6 +397,7 @@ const GridSearchResultsLayout = GObject.registerClass({
 
     vfunc_allocate(container, box) {
         const width = box.get_width();
+        const ltr = container.get_text_direction() !== Clutter.TextDirection.RTL;
 
         const childBox = new Clutter.ActorBox();
         let accumulatedWidth = 0;
@@ -414,7 +415,11 @@ const GridSearchResultsLayout = GObject.registerClass({
             const [childWidth] = child.get_preferred_width(-1);
             const [childHeight] = child.get_preferred_height(-1);
 
-            childBox.set_origin(accumulatedWidth, 0);
+            if (ltr)
+                childBox.set_origin(accumulatedWidth, 0);
+            else
+                childBox.set_origin(width - accumulatedWidth - childWidth, 0);
+
             accumulatedWidth += childWidth;
 
             if (accumulatedWidth <= width)